import request from '@/utils/request'
// 获取员工列表
export const empListAPI = (page, size) => {
  return request({
    url: '/sys/user',
    method: 'get',
    params: {
      page,
      size
    }
  })
}
// 获取员工基本信息
export const empInfoAPI = (id) => {
  return request({
    url: `/sys/user/${id}`,
    method: 'get'
  })
}
// 新增员工
export const addEmpAPI = (Form) => {
  return request({
    url: '/sys/user',
    method: 'post',
    data: Form
  })
}
// 删除员工
export const delListAPI = (id) => {
  return request({
    url: `/sys/user/${id}`,
    method: 'DELETE'
  })
}
// 批量导入员工信息
export const addBatchAPI = (arr) => {
  return request({
    url: `/sys/user/batch`,
    method: 'post',
    data: arr
  })
}
// 修改员工基本信息
export const xgBatchAPI = (obj) => {
  return request({
    url: `/sys/user/${obj.id}`,
    method: 'put',
    data: obj
  })
}
// 分配角色
export const assignAPI = (id, roleIds) => {
  return request({
    url: `/sys/user/assignRoles`,
    method: 'put',
    data: {
      id, roleIds
    }
  })
}
